<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<title>YouTuTV全球最大视频论坛社区个人中心</title>
	<meta name="lee" content="电影,电视剧,博客,论坛,编程开发,教育,资源分享,英语学习,英语语法,教学视频,高考,成人,职业教育">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
	<link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.css}">
	<link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap-theme.css}">
	<script th:src="@{/bootstrap/js/bootstrap.js}"></script>

	<link rel="stylesheet" th:href="@{/layui/css/layui.css}">
	<link rel="stylesheet" th:href="@{/css/mian.css}">
</head>
<body class="lay-blog">
		<div class="header">
			<div class="header-wrap">
				<h1 class="logo pull-left">
					<a href="/">
						<div th:include="header"></div>
					</a>
				</h1>
				<div class="blog-nav pull-right">
					<div th:include="header-nav"></div>
					<a href="#" class="personal pull-left">
						<i class="layui-icon layui-icon-username"></i>
					</a>
				</div>
				<div class="mobile-nav pull-right" id="mobile-nav">
					<a href="javascript:;">
						<i class="layui-icon layui-icon-more"></i>
					</a>
				</div>
			</div>
			<ul class="pop-nav" id="pop-nav">
				<li><a href="/index">首页</a></li>
				<li><a href="/message">留言</a></li>
				<li><a href="/about">关于</a></li>
			</ul>
		</div>
		<div class="container-wrap">
			<div class="container" style="width: 80%;">
					<div class="contar-wrap">
						<h4 class="item-title">
							<p><i class="layui-icon layui-icon-speaker"></i><span>个人中心</span></p>
							<div style="font-size: 13px; padding-left: 40px;width: 100%" th:if="${session.get('name')!=null}">
								你好：<span th:text="${session.get('fullname')}"></span>，
								当前登录用户名：<span th:text="${session.get('name')}"></span>，
								<a href="/logout" style="color: red;border-bottom: 1px solid blue;">退出登录</a>，
								<a th:href="@{/updatePwdPage}">修改密码</a>
								<a th:if="${session.get('name')=='admin'}" th:href="@{/aboutEdit}">，关于</a>
							</div>
							<div th:if="${session.get('name')==null}" style="font-size: 13px; padding-left: 40px">
								<a href="/login.html">请登录</a>
							</div>
						</h4>
						<div>

							<!-- Nav tabs -->
							<ul class="nav nav-tabs" role="tablist" id="myTab">
								<li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">文章管理</a></li>
								<li role="presentation" th:if="${session.get('name')=='admin'}"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">用户管理</a></li>
								<li role="presentation"><a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">视频管理</a></li>
								<li role="presentation"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">待开发</a></li>
							</ul>

							<!-- Tab panes -->
							<div class="tab-content">
								<div role="tabpanel" class="tab-pane active" id="home">
									<table class="layui-table">
										<thead>
										<tr>
											<th>文章标题</th>
											<th>作者</th>
											<th>日期</th>
											<th>操作</th>
										</tr>
										</thead>
										<tbody>
										<tr th:each="ucenter:${ucenterList}">
											<td>
												<a th:href="@{'/detail/'+${ucenter.getId()}}" target="_blank" th:text="${ucenter.getArticleName()}"></a>
											</td>
											<td th:text="${ucenter.getUsername()}"></td>
											<td th:text="${#dates.format(ucenter.getCreateDate(), 'yyyy-MM-dd HH:mm:ss')}"></td>
											<td>
												<a th:href="@{'/articleUpdate/' + ${ucenter.getId()}}">修改</a>
												<a th:href="@{'/delete/'+${ucenter.getId()}}">删除</a>
											</td>
										</tr>
										</tbody>
									</table>
								</div>
								<div role="tabpanel" class="tab-pane" id="profile">
									<table class="layui-table">
										<thead>
										<tr>
											<th>用户名</th>
											<th>真实姓名</th>
											<th>手机号</th>
											<th>是否VIP</th>
											<th>注册日期</th>
											<th>操作</th>
										</tr>
										</thead>
										<tbody>
										<tr th:each="user:${userList}">
											<td th:text="${user.getUsername()}"></td>
											<td th:text="${user.getFullname()}"></td>
											<td th:text="${user.getMobile()}"></td>
											<td th:text="${user.getIsVip()}=='N'?'普通用户':'会员用户'"></td>
											<td th:text="${#dates.format(user.getCreateDate(), 'yyyy-MM-dd HH:mm:ss')}"></td>
											<td>
												<a th:href="@{'/delete/user/'+${user.getId()}}">删除</a>
											</td>
										</tr>
										</tbody>
									</table>
								</div>
								<div role="tabpanel" class="tab-pane" id="messages">
									<a class="btn btn-default" th:href="@{/createVideo}">创建视频</a>
									<table class="layui-table">
										<thead>
										<tr>
											<th>视频名称</th>
<!--											<th>所属分类</th>-->
											<th>审核状态</th>
											<th>上传日期</th>
											<th>上传人</th>
											<th>操作</th>
										</tr>
										</thead>
										<tbody>
										<tr th:each="video:${videoInfoList}">
											<td th:text="${video.getVideoName()}"></td>
<!--											<td th:text="${video.getVideoType()}"></td>-->
											<td th:if="${video.getStatus()}==0" style="color: black">未审核</td>
											<td th:if="${video.getStatus()}==1" style="color: green">审核通过</td>
											<td th:if="${video.getStatus()}==2" style="color: red">审核未通过</td>
											<td th:text="${#dates.format(video.getCreateDate(), 'yyyy-MM-dd HH:mm:ss')}"></td>
											<td th:text="${video.getCreateBy()}"></td>
											<td>
												<a target="_blank" th:href="@{'/findVideo/'+${video.getId()}}">上传</a>
												<a th:href="@{'/updateVideo/'+${video.getId()}}">修改</a>
												<a th:href="@{'/del/'+${video.getId()}}">删除</a>
												<a th:if="${session.get('name')=='admin'}" th:href="@{'/shen/'+${video.getId()}+'/1'}">审核通过</a>
												<a th:if="${session.get('name')=='admin'}" th:href="@{'/shen/'+${video.getId()}+'/2'}">审核不通过</a>
											</td>
										</tr>
										</tbody>
									</table>
								</div>
								<div role="tabpanel" class="tab-pane" id="settings">345</div>
							</div>
						</div>
					</div>
			</div>
		</div>
		<div class="footer">
			<div th:include="food"></div>
		</div>
	<script th:src="@{/layui/layui.js}"></script>
	<!--<script src="../static/layui/layui.js}"></script>-->
	<script>
		layui.config({
		  base: '../static/js/'
		}).use('blog');

		$(function () {
			// $('#myTab a:last').tab('show')
			$('#myTab li a').tabs('show');
		})
	</script>
</body>
</html>